﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Concat
{
    class ScanException : Exception
    {
        public char cur;
        public Location loc;

        public ScanException(string message, char cur, Location loc)
            : base(message)
        {
            this.cur = cur;
            this.loc = loc;
        }
    }
    class InvalidCharacterException : ScanException
    {
        public InvalidCharacterException(char cur, Location loc)
            : base("Invalid character at " + loc.ToString() + ".", cur, loc)
        {
        }
    }
    class UndelimitedStringException : ScanException
    {
        public Location stringStart;
        public UndelimitedStringException(Location stringStart, Location eof)
            : base("Undelimited string starting at " + stringStart.ToString() + ".", '\0', eof)
        {
            this.stringStart = stringStart;
        }
    }
}
